import React, { Component } from 'react';
import './index.css'
import Top from '../../components/Top';
import ClassBanner from '../../components/ClassBanner'
import ClassContent from '../../components/ClassContent'
import axios from 'axios'
class List extends Component {
  state = {
    list:[],
    listBanner:[]
  }
  render() {
    return (
      <div className="list-container">
          <Top name={'榜单'} />
          <ClassBanner listBanner={this.state.listBanner}/>
          <ClassContent list={this.state.list}/>
      </div>
    );
  }
  componentDidMount(){
    this.getClassListData()
    this.setState({
      title:this.props.match.params.bangdan
    })
  }

  getClassListData(){
    axios({
      method:'GET',
      url:'https://wxapi.chuangbie.com/wap/book/rank.html'
    }).then(res =>{
      console.log(res);
      this.setState({
        list:res.data.data.list,
        listBanner:res.data.data.banner
      })
      
    })
  }
  
}

export default List;